package com.ocom.payhandle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.payconfig.EntityFkUserparamConfig;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.mysql.aspect.DataSourceAspect;
import com.ocom.payhandle.dao.IDaoFkUserparamConfig;
import com.ocom.payhandle.service.FkUserparamConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FkUserparamConfigServiceImpl extends ServiceImpl<IDaoFkUserparamConfig, EntityFkUserparamConfig> implements FkUserparamConfigService {


    @Autowired
    private IDaoFkUserparamConfig iDaoFkUserparamConfig;

    @DataSourceAspect(type = DataSourceEnum.PART_DB,companyId = "companyId")
    @Override
    public List<EntityFkUserparamConfig> selectFkUserparamConfigList(Long companyId, int parentMerchId) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("com_id",companyId);
        queryWrapper.eq("merch_id",parentMerchId);
        return iDaoFkUserparamConfig.selectList(queryWrapper);
    }
}
